package manager;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import model.Types;
import idao.ITypesDAO;
import imanager.ITypesManager;

@Service
public class TypesManager implements ITypesManager {

	@Autowired
	private ITypesDAO typesDAO;

	public ITypesDAO getTypesDAO() {
		return typesDAO;
	}

	public void setTypesDAO(ITypesDAO typesDAO) {
		this.typesDAO = typesDAO;
	}

	public TypesManager() {
		// TODO Auto-generated constructor stub
	}

	public TypesManager(ITypesDAO typesDAO) {
		this.typesDAO = typesDAO;
	}

	@Transactional
	public boolean insert(Types types) {
		// TODO Auto-generated method stub
		return typesDAO.insert(types);
	}

	@Transactional
	public boolean update(Types types) {
		// TODO Auto-generated method stub
		return typesDAO.update(types);
	}

	@Transactional
	public boolean delete(Types types) {
		// TODO Auto-generated method stub
		return typesDAO.delete(types);
	}

	@Transactional
	public Types getTypeByID(int ID) {
		// TODO Auto-generated method stub
		return typesDAO.getTypeByID(ID);
	}

	@Transactional
	public List<Types> getAll() {
		// TODO Auto-generated method stub
		return typesDAO.getAll();
	}

}
